from django.db import models


# Create your models here.

# # 创建用户表
# class User(models.Model):
#     username = models.CharField(max_length=50, verbose_name='用户名')
#     password = models.CharField(max_length=50, verbose_name='密码')
#     phone = models.CharField(max_length=11, verbose_name='手机号')
#
#     class Meta:
#         db_table = 'user'
#
#
# # 创建区域表
# class Area(models.Model):
#     pass
#
#
# # 用户地址表
# class Address(models.Model):
#     # 用户id
#     # 接收人
#     name = models.CharField(max_length=40, verbose_name='接收人')
#     # 地址 省,市,区
#     site = models.CharField(50, verbose_name='地址,省 市 区')
#     # 电话
#     phone = models.CharField(max_length=11, verbose_name='电话')
#     # 地址
#     bar = models.CharField(max_length=100, verbose_name='详细地址')
#     # 是否删除 1代表是 2代表否
#     deletes = models.BooleanField(default=2, verbose_name='是否删除')
#     # 是否默认 1代表默认 2代表不默认
#     default = models.BooleanField(default=1, verbose_name='是否默认')
#
#     # 固定电话
#
#     # 邮箱
#     class Meta:
#         db_table = 'address'


# 创建新闻表
class Journalism(models.Model):
    title = models.CharField(max_length=50, verbose_name='标题')
    content = models.TextField(verbose_name='内容')

    def __str__(self):
        return self.title

    class Meta:
        db_table = 'journalism'


# 创建广告表
class Advertising(models.Model):
    pict = models.ImageField(verbose_name='图片')
    jump = models.URLField(verbose_name='跳转地址')
    type = models.CharField(max_length=50, verbose_name='类型')

    class Meta:
        db_table = 'advertising'
